using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;

namespace PicturePage
{
    public partial class TemplateFind : Form
    {
        TextBox insertBox;

        public TemplateFind(string templateFile, TextBox insert)
        {
            InitializeComponent();

            insertBox = insert;

            string[] file = File.ReadAllLines(templateFile);
            foreach (string line in file)
            {
                this.txtTemplate.AppendText(line + "\r\n");
            }
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            this.insertBox.Text = this.txtTemplate.SelectedText;

            this.Close();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}